package com.hps.spring.cloud.alibaba.controller;

import java.security.Principal;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author heps
 * @since 2020/11/4 13:49
 */
@Slf4j
@RestController
@RequestMapping("/users")
public class UserController {

  @RequestMapping(value = "/current", method = RequestMethod.GET)
  public Principal getUser(Principal principal) {
    return principal;
  }
}
